# -*- coding: utf-8 -*-
# @Time    : 28 12月 2024 11:59 上午
# @Author  : codervibe
# @File    : 隐藏内容的解析.py
# @Project : pythonBasics
"""
后面的内容: 0a0a677572206e61666a72652079767266207661206775722061687a6f7265662e204f6867206c626820756e6972206762207068672071626a6120677572206a62627166206775726c206f722072657162662e0a3232203731203634203438203636203730203736203438203638203730203836203332203934203837203130302039322032322037392037382037302038382038362038322033362036362035362037302037352034362036340a
"""
import codecs

from stegano import lsb

# Rot13 解密字符串
def rot13_decrypt(text):
    """
    使用Rot13算法解密字符串。

    参数:
    text (str): 待解密的字符串。

    返回:
    str: 解密后的字符串。
    """
    return codecs.decode(text, 'rot_13')

隐藏的信息 = "0a0a677572206e61666a72652079767266207661206775722061687a6f7265662e204f6867206c626820756e6972206762207068672071626a6120677572206a62627166206775726c206f722072657162662e0a3232203731203634203438203636203730203736203438203638203730203836203332203934203837203130302039322032322037392037382037302038382038362038322033362036362035362037302037352034362036340a"
# 隐藏的信息为 十六进制
隐藏的信息十进制 = bytes.fromhex(隐藏的信息)
print(f"隐藏的信息十进制:{隐藏的信息十进制}")
# 隐藏的信息十进制 转换为 str
隐藏的信息十进制字符串 = 隐藏的信息十进制.decode('utf-8')
# 隐藏的信息十进制字符串 去掉\n
隐藏的信息十进制字符串 = 隐藏的信息十进制字符串.replace('\n', '')
print(f"隐藏的信息十进制字符串:{隐藏的信息十进制字符串}")
# 隐藏的信息十进制 以. 进行分割成列表
隐藏的信息十进制列表 = 隐藏的信息十进制字符串.split('.')



print(rot13_decrypt(f"隐藏的信息十进制列表[0]:{隐藏的信息十进制列表[0]}"))
print(rot13_decrypt(f"隐藏的信息十进制列表[1]:{隐藏的信息十进制列表[1]}"))
print(f"隐藏的信息十进制列表[2]:{隐藏的信息十进制列表[2]}")

ext_Infor = "Perhaps you see this and wonder what the fuck is going on, What is this bullshit. Well, the solution is Right in front of your eyes, you just have to look closer. Just follow the numbers and you will find the answer. Did you find it?"
# 字符串中的空格换成","
隐藏的信息十进制列表[2] = 隐藏的信息十进制列表[2].replace(' ', ',')
print(隐藏的信息十进制列表[2])
# print(type(隐藏的信息十进制列表[2]))
# 隐藏的信息十进制列表[2] 以空格为分割为一个列表
index = 隐藏的信息十进制列表[2].split(',')
print(index)
index = list(隐藏的信息十进制列表[2])
